﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    //Description:	Overwrite a portion of a string at a specified index. input values to be fixed width, fixed position strings.
    /*
        string s = new String(' ',60);
        s = s.Overwrite(7,"NewValue");
    */

    public static partial class StringExtensions
    {
        public static string Overwrite(this string s, int startIndex, string newStringValue)
        {
            return s.Remove(startIndex, newStringValue.Length).Insert(startIndex, newStringValue);
        }
    }
}
